home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: I can't print the date in the format I want.
- Date: 24 Feb 1996 00:52:19 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Feb23175219@qcd.lanl.gov>
- References: <4g5nbf$8s0@newsbf02.news.aol.com> <3129e355.114134@news.iquest.net>
- <825035732snz@genesis.demon.co.uk> <312de5dc.416111@news.iquest.net>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: rclark@iquest.net's message of Fri, 23 Feb 1996 16:12:38 GMT
-
- In article <312de5dc.416111@news.iquest.net>
- rclark@iquest.net (Robert B. Clark) writes:
- <snip>
- RBC: thought I'd comment on it anyway. I suggested that if the original
- RBC: poster wanted to use it thus, he might want to hide it in a moe
- RBC: appropriately-named macro, such as
- RBC:
- RBC: #define PAUSE if (getchar()) {}
-
-
- And then, (s)he would be tempted to write:
-
- if (some_funny_condition) PAUSE;
- else just_show_the_results();
-
- :-)
-
- Why not the solution suggested in FAQ
- #define PAUSE do { if(getchar()) {} } while(0)
-
- Of course, I have no idea what this is supposed to be doing ... I have
- not been following this thread. #define PAUSE (void)getchar() seems to
- be sufficient for most purposes, and compilers should be smart enough
- to recognize that an explicit cast to (void) means that the user is
- ignoring the return value deliberately. In any case, why the compiler
- should think that `code has no effect' is beyond me.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-